<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
<%--    <script>
        window.onload=function () {
            document.getElementById("from").onsubmit=function(){

                return checkAge()&&checkName(); /*&& checkEmail();*/
            }
            document.getElementById("age").onblur=checkAge;
            document.getElementById("name").onblur=checkName;
            //document.getElementById("email").onblur=checkEmail;
        }
        function checkAge() {
            var age=document.getElementById("age").value;
            var age1=/^(?:[1-9][0-9]?|1[01][0-9]|120)$/;//年龄是1-120之间有效
            var flag=age1.text(age)
            var td_age=document.getElementById("td_age");
            if (flag){
                td_age.innerHTML="<img src='/WEB-INF/imp/gou.png' height='25' width='35'>" ;
            }else {
                td_age.innerText="输入的年龄有问题，年龄在1-120之间";
            }
            return flag;
        }
        function checkName() {
            var name=document.getElementById("age").value;
            var name1=/^([\u4e00-\u9fa5]){2,7}$/;//姓名只能用中文
            var flag=name1.text(name)
            var td_name=document.getElementById("td_name");
            if (flag){
                td_name.innerHTML="<img src='/WEB-INF/imp/gou.png' height='25' width='35'>" ;
            }else {
                td_name.innerText="输入的姓名有问题，姓名只能是中文";
            }
            return flag;
        }
   /*     function checkAddress() {
            var address=document.getElementById("age").value;
            var address1=/^([\u4e00-\u9fa5]){2,7}$/;//姓名只能用中文
            var flag=address1.text(address)
            var td_address=document.getElementById("td_address");
            if (flag){
                td_address.innerHTML="<img src='/WEB-INF/imp/gou.png' height='25' width='35'>" ;
            }else {
                td_address.innerText="输入的姓名有问题，姓名只能是中文";
            }
            return flag;
        }*/
    </script>--%>
</head>
<body>
<form name="accountForm" action="${pageContext.request.contextPath}/employee/save" method="post">
    员工年龄:<input type="text" name="age"><br>
    员工姓名:<input type="text" name="name"><br>
    员工性别:<input type="text" name="sex"><br>
    员工地址:<input type="text" name="address"><br>
    <input type="submit" value="保存"><br>
</form>
</body>
</html>
